Skip to content

WIP: DOC/Figure.paragraph: Add a gallery example to show formating long text as paragraphs #4592

Draft
yvonnefroehlich wants to merge 8 commits intomainfrom
add-gallery-paragraph
Draft

WIP: DOC/Figure.paragraph: Add a gallery example to show formating long text as paragraphs #4592
yvonnefroehlich wants to merge 8 commits intomainfrom
add-gallery-paragraph

Conversation

@yvonnefroehlich
Copy link
Copy Markdown
Member

@yvonnefroehlich yvonnefroehlich commented Apr 16, 2026

Description of proposed changes

This PR aims to add a gallery example to show the usage of the newly added high-level method Figure.paragraph.

Currently this is a standalone example. I am a bit wondering if it can make sense to add this to the already existing gallery example Formatting text becauseFigure.paragraph is related to -M of Figure.text.

Please note the upstream bug reported in #4590. I will write a related GMT code example and issue hopefully this night or tomorrow - Edit Upstream bug report at GenericMappingTools/gmt#8989 - Edit 2026/04/22 PR with a fix in the GMT codes was merged.

Preview: https://pygmt-dev--4592.org.readthedocs.build/en/4592/gallery/embellishments/paragraph.html

Guidelines

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

@yvonnefroehlich yvonnefroehlich added this to the 0.19.0 milestone Apr 16, 2026
@yvonnefroehlich yvonnefroehlich self-assigned this Apr 16, 2026
@yvonnefroehlich yvonnefroehlich added the documentation Improvements or additions to documentation label Apr 16, 2026
@yvonnefroehlich yvonnefroehlich marked this pull request as draft April 16, 2026 16:55
@seisman
Copy link
Copy Markdown
Member

seisman commented Apr 17, 2026

I am a bit wondering if it can make sense to add this to the already existing gallery example Formatting text

I think it makes more sense to have a separate example.

becauseFigure.paragraph is related to -M of Figure.text.

I feel these are technical details that users don't have to know, especially for PyGMT users who are not familiar with GMT CLI syntax.

Comment thread examples/gallery/embellishments/paragraph.py Outdated
Comment thread examples/gallery/embellishments/paragraph.py Outdated
yvonnefroehlich and others added 2 commits April 21, 2026 23:03
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment on lines +2 to +3
Paragraph
=========
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Paragraph
=========
Paragraphs of long text
=======================

Paragraph
=========

To plot longer text as one or several paragraphs the :meth:`pygmt.Figure.paragraph`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To plot longer text as one or several paragraphs the :meth:`pygmt.Figure.paragraph`
To typeset long text as one or several paragraphs the :meth:`pygmt.Figure.paragraph`


To plot longer text as one or several paragraphs the :meth:`pygmt.Figure.paragraph`
method can be used. The ``parwidth`` and ``linespacing`` parameters allow to set
the line length and spacing of the paragraph, respectively.` The desired text can
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the line length and spacing of the paragraph, respectively.` The desired text can
the width of the paragraph and line spacing, respectively. The desired text can

@seisman
Copy link
Copy Markdown
Member

seisman commented Apr 22, 2026

Maybe we can try to recreate the GMT example/test at https://github.com/GenericMappingTools/gmt/blob/master/test/pstext/shade_text.sh.

shade_text

@yvonnefroehlich
Copy link
Copy Markdown
Member Author

yvonnefroehlich commented Apr 22, 2026

Maybe we can try to recreate the GMT example/test at https://github.com/GenericMappingTools/gmt/blob/master/test/pstext/shade_text.sh.

Looks like a nice example, but I think it would be good to use a text that consists of at least two paragraphs.
In case you already worked locally on a gallery example based on this example, we can also close this PR, as my example is at an early state and you can open an own PR for a gallery example based on the GMT example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants